import request from '@/utils/request'

// 查询项目申报列表
export function listXmsb(query) {
  return request({
    url: '/kylx/xmsb/list',
    method: 'get',
    params: query
  })
}

// 查询项目申报列表 (项目申报页面使用)
export function getXmsbList(query) {
  return request({
    url: '/kylx/xmsb/getXmsbList',
    method: 'get',
    params: query
  })
}

// 查询项目申报详细
export function getXmsb(xmsbId) {
  return request({
    url: '/kylx/xmsb/' + xmsbId,
    method: 'get'
  })
}

// 查询项目申报与项目计划进度和目标
export function selectLlglXmsbByjhjdByXmsbId(xmsbId) {
  return request({
    url: '/kylx/xmsb/jhjd/' + xmsbId,
    method: 'get'
  })
}

// 获取项目申报与研发费用预算上信息信息
export function selectLlglXmsbByyffyByXmsbId(xmsbId) {
  return request({
    url: '/kylx/xmsb/yffy/' + xmsbId,
    method: 'get'
  })
}

// 获取项目申报与研发费用预算下信息信息
export function selectLlglXmsbByyffysByXmsbId(xmsbId) {
  return request({
    url: '/kylx/xmsb/yffys/' + xmsbId,
    method: 'get'
  })
}

// 获取项目申报与研发费用研发材料
export function selectLlglXmsbByYfclByXmsbId(xmsbId) {
  return request({
    url: '/kylx/xmsb/yfcl/' + xmsbId,
    method: 'get'
  })
}

// 获取项目申报与研发费用研发设备
export function selectLlglXmsbYfsbByXmsbId(xmsbId) {
  return request({
    url: '/kylx/xmsb/yfsb/' + xmsbId,
    method: 'get'
  })
}

// 获取项目申报与研发费用中间试验费
export function selectLlglXmsbZjsyfByXmsbId(xmsbId) {
  return request({
    url: '/kylx/xmsb/zjsyf/' + xmsbId,
    method: 'get'
  })
}

// 获取项目申报与课题组成人员
export function selectLlglXmsbZcryByXmsbId(xmsbId) {
  return request({
    url: '/kylx/xmsb/zcry/' + xmsbId,
    method: 'get'
  })
}

// 查询当前公司今年已立项的立项数
export function selectProjectNumber(year, middlePart) {
  return request({
    url: '/kylx/xmsb/count',
    method: 'get',
    params: {
      year: year,
      middlePart: middlePart
    }
  })
}

// 查询当前公司今年已立项的第一个立项编号
export function selectCountLxbh(year, middlePart) {
  return request({
    url: '/kylx/xmsb/countLxbh',
    method: 'get',
    params: {
      year: year,
      middlePart: middlePart
    }
  })
}

// 新增项目申报
export function addXmsb(data) {
  return request({
    url: '/kylx/xmsb',
    method: 'post',
    data: data
  })
}

// 修改项目申报
export function updateXmsb(data) {
  return request({
    url: '/kylx/xmsb',
    method: 'put',
    data: data
  })
}

// 课题归属转换
export function updateKtgs(data) {
  return request({
    url: '/kylx/xmsb/updateKtgs',
    method: 'put',
    data: data
  })
}

// 删除项目申报
export function delXmsb(xmsbId) {
  return request({
    url: '/kylx/xmsb/' + xmsbId,
    method: 'delete'
  })
}

// 新增附件
export function insertLxglXmsbFjByxmsbId(data) {
  return request({
    url: '/kylx/xmsb/add/File/By/subId',
    method: 'post',
    data: data
  })
}

// 根据主表ID查询附件列表
export function selectLxglXmsbFjList(xmsbId) {
  return request({
    url: '/kylx/xmsb/get/FileList/By/subId?sId=' + xmsbId,
    method: 'get'
  })
}

// 根据id删除附件
export function removeFileBySunId(id) {
  return request({
    url: '/kylx/xmsb/remove/file/by/id?id=' + id,
    method: 'get'
  })
}

// 查询当前最新的主表主键ID
export function selectMAXId() {
  return request({
    url: '/kylx/xmsb/selectMAXId',
    method: 'get'
  })
}

// 新增附件
export function moveJhjdRow(data) {
  return request({
    url: '/kylx/xmsb/move/jhjd/row',
    method: 'post',
    data: data
  })
}

// 根据模板导出word
export function exportXmsbWord(query, xmsbId) {
  return request({
    url: '/kylx/xmsb/exportWord/' + xmsbId,
    method: 'get',
    params: query
  })
}

// 根据主表ID查询附件列表
export function selectDjIdByXmDeptId(xmDeptId) {
  return request({
    url: '/kylx/xmsb/selectDjIdByXmDeptId?xmDeptId=' + xmDeptId,
    method: 'get'
  })
}
